<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        margin-top: 10px;
        padding: 10px;
        background: #686de0;
      }
      /* 1. */
      /* .fade-enter-active,
      .fade-leave-active {
        transition: opacity 0.5s;
      }
      .fade-enter,
      .fade-leave-to {
        opacity: 0;
      } */
      /* 2. */
      /* .fade-enter-active {
        transition: all 0.2s;
      }
      .fade-leave-active {
        transition: all 0.8s;
      }
      .fade-enter,
      .fade-leave-to {
        transform: translateX(10px);
        opacity: 0;
      } */
      /* 3.添加帧动画 */
      .fade-enter-active {
        animation: bound-in 0.5s;
      }
      .fade-leave-active {
        animation: bound-in 0.5s reverse;
      }
      @keyframes bound-in {
        0% {
          transform: scale(0);
        }
        50% {
          transform: scale(1.5);
        }
        100% {
          transform: scale(1);
        }
      }
    </style>
  </head>
  <body>
    <div id="app">
      <button v-on:click="show = !show">Toggle</button>
      <transition name="fade">
        <div v-if="show" class="box">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempore, rem?</div>
      </transition>
    </div>
    <script src="../packages/vue.min.js"></script>
    <script>
      new Vue({
        data() {
          return {
            count: 100,
            show: true,
          }
        },
      }).$mount('#app')
    </script>
  </body>
</html>
